import React,{Component}  from 'react'

export default class Demo03_live extends Component {
  constructor(props){
    super(props);
    this.state={
      val:'hhhhhhh'
    }
    this.onChange=this.onChange.bind(this)
  }
  componentDidMount(){
    console.log(11111);
    this.get();
  }
  get(){
    console.log('获得数据');
    console.log(this.props);
  }
  onChange(e){
    console.log(e.target.value);
    //var val= e.target.value
    this.setState({
      val:e.target.value
    })
  }
  render(){
    return (
        <div>
          <button onClick={this.get.bind(this)}>test click</button>
          <input type="text" onChange={this.onChange} placeholder={this.state.val}/>
          <p>inputval :{this.state.val}</p>
        </div>
    )
  }
}
  